package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.ProYear;
import com.ruoyi.system.mapper.ProjectsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.YearMessageMapper;
import com.ruoyi.system.domain.YearMessage;
import com.ruoyi.system.service.IYearMessageService;

/**
 * 年度信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-01-07
 */
@Service
public class YearMessageServiceImpl implements IYearMessageService 
{
    @Autowired
    private YearMessageMapper yearMessageMapper;



    //修改年度信息
    @Override
    public int updateYearMessage(ProYear proYear)
    {
        if(yearMessageMapper.querySum(proYear.getMesYear(),proYear.getMesId(),proYear.getProId())<=0) {
            return yearMessageMapper.updateYearMessage(proYear);
        }else{
            return 0;
        }
    }



    //删除年度信息
    @Override
    public int deleteYearMessageById(Long mesId)
    {

        return yearMessageMapper.deleteYearMessageById(mesId);
    }

    //新增年度信息
    @Override
    public int insertYearMessage(ProYear proYear)
    {
       if(yearMessageMapper.querySum(proYear.getMesYear(),proYear.getMesId(),proYear.getProId())<=0) {
           return yearMessageMapper.insertYearMessage(proYear);
       }else{
           return 0;
       }
    }






}
